﻿package com.example.demo.dao
import com.example.demo.dao.*
import me.liuwj.ktorm.entity.Entity
import me.liuwj.ktorm.schema.Table
import me.liuwj.ktorm.database.Database
import me.liuwj.ktorm.entity.sequenceOf
import me.liuwj.ktorm.dsl.*
import me.liuwj.ktorm.entity.EntitySequence
import me.liuwj.ktorm.schema.BaseTable
import me.liuwj.ktorm.schema.ColumnDeclaring

/**
 * codeGen version:2.2
 * codeGen github:https://github.com/yuzd/AntData.ORM
**/
object Tables {
    /**
     *  病人入院、出院、转床,转床信息表
     **/
    val tAdmTran = TAdmTranDao
    /**
     *  病人入院、出院、转床,转床信息表
     **/
    val Database.tAdmTrans get() = this.sequenceOf(TAdmTranDao,false)
    /**
     *  过敏类型表
     **/
    val tAllergy = TAllergyDao
    /**
     *  过敏类型表
     **/
    val Database.tAllergies get() = this.sequenceOf(TAllergyDao,false)
    /**
     *  app软件版本
     **/
    val tAppVersion = TAppVersionDao
    /**
     *  app软件版本
     **/
    val Database.tAppVersions get() = this.sequenceOf(TAppVersionDao,false)
    /**
     *  床位表
     **/
    val tBed = TBedDao
    /**
     *  床位表
     **/
    val Database.tBeds get() = this.sequenceOf(TBedDao,false)
    /**
     *  血压计表
     **/
    val tBloodPress = TBloodPressDao
    /**
     *  血压计表
     **/
    val Database.tBloodPresses get() = this.sequenceOf(TBloodPressDao,false)
    /**
     *  体温表
     **/
    val tBodyHeat = TBodyHeatDao
    /**
     *  体温表
     **/
    val Database.tBodyHeats get() = this.sequenceOf(TBodyHeatDao,false)
    /**
     *  护理标签表
     **/
    val tCareLabel = TCareLabelDao
    /**
     *  护理标签表
     **/
    val Database.tCareLabels get() = this.sequenceOf(TCareLabelDao,false)
    /**
     *  病人费用信息
     **/
    val tCharge = TChargeDao
    /**
     *  病人费用信息
     **/
    val Database.tCharges get() = this.sequenceOf(TChargeDao,false)
    /**
     *  编码列表
     **/
    val tCodeList = TCodeListDao
    /**
     *  编码列表
     **/
    val Database.tCodeLists get() = this.sequenceOf(TCodeListDao,false)
    /**
     *  科室
     **/
    val tDept = TDeptDao
    /**
     *  科室
     **/
    val Database.tDepts get() = this.sequenceOf(TDeptDao,false)
    /**
     *  设备
     **/
    val tDevice = TDeviceDao
    /**
     *  设备
     **/
    val Database.tDevices get() = this.sequenceOf(TDeviceDao,false)
    /**
     *  病区
     **/
    val tDistrict = TDistrictDao
    /**
     *  病区
     **/
    val Database.tDistricts get() = this.sequenceOf(TDistrictDao,false)
    /**
     *  医生表
     **/
    val tDoctor = TDoctorDao
    /**
     *  医生表
     **/
    val Database.tDoctors get() = this.sequenceOf(TDoctorDao,false)
    /**
     *  医嘱表
     **/
    val tDoctorOrder = TDoctorOrderDao
    /**
     *  医嘱表
     **/
    val Database.tDoctorOrders get() = this.sequenceOf(TDoctorOrderDao,false)
    /**
     *  药物表
     **/
    val tDrug = TDrugDao
    /**
     *  药物表
     **/
    val Database.tDrugs get() = this.sequenceOf(TDrugDao,false)
    /**
     *  病人检查结果
     **/
    val tExam = TExamDao
    /**
     *  病人检查结果
     **/
    val Database.tExams get() = this.sequenceOf(TExamDao,false)
    /**
     *  病人费用
     **/
    val tFee = TFeeDao
    /**
     *  病人费用
     **/
    val Database.tFees get() = this.sequenceOf(TFeeDao,false)
    /**
     *  食堂菜单
     **/
    val tFoodMenu = TFoodMenuDao
    /**
     *  食堂菜单
     **/
    val Database.tFoodMenus get() = this.sequenceOf(TFoodMenuDao,false)
    /**
     *  食堂订单
     **/
    val tFoodOrder = TFoodOrderDao
    /**
     *  食堂订单
     **/
    val Database.tFoodOrders get() = this.sequenceOf(TFoodOrderDao,false)
    /**
     *  食堂订单明细
     **/
    val tFoodOrderDetail = TFoodOrderDetailDao
    /**
     *  食堂订单明细
     **/
    val Database.tFoodOrderDetails get() = this.sequenceOf(TFoodOrderDetailDao,false)
    /**
     *  医院表
     **/
    val tHospital = THospitalDao
    /**
     *  医院表
     **/
    val Database.tHospitals get() = this.sequenceOf(THospitalDao,false)
    /**
     *  病人检验记录
     **/
    val tInspect = TInspectDao
    /**
     *  病人检验记录
     **/
    val Database.tInspects get() = this.sequenceOf(TInspectDao,false)
    /**
     *  病人检验结果
     **/
    val tInspectResult = TInspectResultDao
    /**
     *  病人检验结果
     **/
    val Database.tInspectResults get() = this.sequenceOf(TInspectResultDao,false)
    /**
     *  多媒体
     **/
    val tMedia = TMediaDao
    /**
     *  多媒体
     **/
    val Database.tMedia get() = this.sequenceOf(TMediaDao,false)
    /**
     *  菜单表
     **/
    val tMenu = TMenuDao
    /**
     *  菜单表
     **/
    val Database.tMenus get() = this.sequenceOf(TMenuDao,false)
    /**
     *  护士表
     **/
    val tNurse = TNurseDao
    /**
     *  护士表
     **/
    val Database.tNurses get() = this.sequenceOf(TNurseDao,false)
    /**
     *  护理等级字典表
     **/
    val tNurseLevel = TNurseLevelDao
    /**
     *  护理等级字典表
     **/
    val Database.tNurseLevels get() = this.sequenceOf(TNurseLevelDao,false)
    /**
     *  手术安排表
     **/
    val tOperation = TOperationDao
    /**
     *  手术安排表
     **/
    val Database.tOperations get() = this.sequenceOf(TOperationDao,false)
    /**
     *  血氧仪表
     **/
    val tOxymeter = TOxymeterDao
    /**
     *  血氧仪表
     **/
    val Database.tOxymeters get() = this.sequenceOf(TOxymeterDao,false)
    /**
     *  病人表
     **/
    val tPatient = TPatientDao
    /**
     *  病人表
     **/
    val Database.tPatients get() = this.sequenceOf(TPatientDao,false)
    /**
     *  病人和护理标签关联表
     **/
    val tPatientCareLabelRef = TPatientCareLabelRefDao
    /**
     *  病人和护理标签关联表
     **/
    val Database.tPatientCareLabelRefs get() = this.sequenceOf(TPatientCareLabelRefDao,false)
    /**
     *  病人信息（手工录入)
     **/
    val tPatientExtra = TPatientExtraDao
    /**
     *  病人信息（手工录入)
     **/
    val Database.tPatientExtras get() = this.sequenceOf(TPatientExtraDao,false)
    /**
     *  住院记录
     **/
    val tPatientView = TPatientViewDao
    /**
     *  住院记录
     **/
    val Database.tPatientViews get() = this.sequenceOf(TPatientViewDao,false)
    /**
     *  PDA动态页面
     **/
    val tPdaPage = TPdaPageDao
    /**
     *  PDA动态页面
     **/
    val Database.tPdaPages get() = this.sequenceOf(TPdaPageDao,false)
    /**
     *  PDA动态页面控件
     **/
    val tPdaPageControl = TPdaPageControlDao
    /**
     *  PDA动态页面控件
     **/
    val Database.tPdaPageControls get() = this.sequenceOf(TPdaPageControlDao,false)
    /**
     *  PDA动态页面数据
     **/
    val tPdaPageData = TPdaPageDataDao
    /**
     *  PDA动态页面数据
     **/
    val Database.tPdaPageData get() = this.sequenceOf(TPdaPageDataDao,false)
    /**
     *  PDA动态页面选项
     **/
    val tPdaPageOption = TPdaPageOptionDao
    /**
     *  PDA动态页面选项
     **/
    val Database.tPdaPageOptions get() = this.sequenceOf(TPdaPageOptionDao,false)
    /**
     *  数据收集结果
     **/
    val tPdaPageResult = TPdaPageResultDao
    /**
     *  数据收集结果
     **/
    val Database.tPdaPageResults get() = this.sequenceOf(TPdaPageResultDao,false)
    /**
     *  角色表
     **/
    val tRole = TRoleDao
    /**
     *  角色表
     **/
    val Database.tRoles get() = this.sequenceOf(TRoleDao,false)
    /**
     *  角色的部门
     **/
    val tRoleDeptRef = TRoleDeptRefDao
    /**
     *  角色的部门
     **/
    val Database.tRoleDeptRefs get() = this.sequenceOf(TRoleDeptRefDao,false)
    /**
     *  角色和菜单关系表
     **/
    val tRoleMenuRef = TRoleMenuRefDao
    /**
     *  角色和菜单关系表
     **/
    val Database.tRoleMenuRefs get() = this.sequenceOf(TRoleMenuRefDao,false)
    /**
     *  房间表
     **/
    val tRoom = TRoomDao
    /**
     *  房间表
     **/
    val Database.tRooms get() = this.sequenceOf(TRoomDao,false)
    /**
     *  数据收集结果
     **/
    val tSatisfySurveyResult = TSatisfySurveyResultDao
    /**
     *  数据收集结果
     **/
    val Database.tSatisfySurveyResults get() = this.sequenceOf(TSatisfySurveyResultDao,false)
    /**
     *  排班表
     **/
    val tShiftPlan = TShiftPlanDao
    /**
     *  排班表
     **/
    val Database.tShiftPlans get() = this.sequenceOf(TShiftPlanDao,false)
    /**
     *  排班类型
     **/
    val tShiftType = TShiftTypeDao
    /**
     *  排班类型
     **/
    val Database.tShiftTypes get() = this.sequenceOf(TShiftTypeDao,false)
    /**
     *  系统定时任务
     **/
    val tSysJob = TSysJobDao
    /**
     *  系统定时任务
     **/
    val Database.tSysJobs get() = this.sequenceOf(TSysJobDao,false)
    /**
     *  系统定时任务日志
     **/
    val tSysJobLog = TSysJobLogDao
    /**
     *  系统定时任务日志
     **/
    val Database.tSysJobLogs get() = this.sequenceOf(TSysJobLogDao,false)
    /**
     *  用户数据表
     **/
    val tUser = TUserDao
    /**
     *  用户数据表
     **/
    val Database.tUsers get() = this.sequenceOf(TUserDao,false)
    /**
     *  用户的部门列表
     **/
    val tUserDeptRef = TUserDeptRefDao
    /**
     *  用户的部门列表
     **/
    val Database.tUserDeptRefs get() = this.sequenceOf(TUserDeptRefDao,false)
    /**
     *  用户日志
     **/
    val tUserLog = TUserLogDao
    /**
     *  用户日志
     **/
    val Database.tUserLogs get() = this.sequenceOf(TUserLogDao,false)
    /**
     *  用户和角色关系表
     **/
    val tUserRoleRef = TUserRoleRefDao
    /**
     *  用户和角色关系表
     **/
    val Database.tUserRoleRefs get() = this.sequenceOf(TUserRoleRefDao,false)
    /**
     *  生命体征
     **/
    val tVitalSign = TVitalSignDao
    /**
     *  生命体征
     **/
    val Database.tVitalSigns get() = this.sequenceOf(TVitalSignDao,false)
    /**
     *  生命体征
     **/
    val tVitalSignLast = TVitalSignLastDao
    /**
     *  生命体征
     **/
    val Database.tVitalSignLasts get() = this.sequenceOf(TVitalSignLastDao,false)
    /**
     *  护理计划
     **/
    val tWorkPlan = TWorkPlanDao
    /**
     *  护理计划
     **/
    val Database.tWorkPlans get() = this.sequenceOf(TWorkPlanDao,false)
    /**
     * View
     *  VIEW
     **/
    val vAppVersion = VAppVersionDao
    /**
     * View
     *  VIEW
     **/
    val Database.vAppVersions get() = this.sequenceOf(VAppVersionDao,false)
    /**
     * View
     *  VIEW
     **/
    val vBed = VBedDao
    /**
     * View
     *  VIEW
     **/
    val Database.vBeds get() = this.sequenceOf(VBedDao,false)
    /**
     * View
     *  VIEW
     **/
    val vDevice = VDeviceDao
    /**
     * View
     *  VIEW
     **/
    val Database.vDevices get() = this.sequenceOf(VDeviceDao,false)
    /**
     * View
     *  VIEW
     **/
    val vPatient = VPatientDao
    /**
     * View
     *  VIEW
     **/
    val Database.vPatients get() = this.sequenceOf(VPatientDao,false)
    /**
     * View
     *  VIEW
     **/
    val vUser = VUserDao
    /**
     * View
     *  VIEW
     **/
    val Database.vUsers get() = this.sequenceOf(VUserDao,false)
    /**
     * View
     *  VIEW
     **/
    val vUserMenu = VUserMenuDao
    /**
     * View
     *  VIEW
     **/
    val Database.vUserMenus get() = this.sequenceOf(VUserMenuDao,false)
    fun <E : Any, T : BaseTable<E>> EntitySequence<E, T>.insert(block: AssignmentsBuilder.(T) -> Unit):Int{
        return this.database.insert(this.sourceTable,block)
    }
    fun <E : Any, T : BaseTable<E>> EntitySequence<E, T>.update( block: UpdateStatementBuilder.(T) -> Unit):Int{
        return this.database.update(this.sourceTable,block)
    }
    fun <E : Any, T : BaseTable<E>> EntitySequence<E, T>.upgrade( block: UpdateStatementBuilder.(T) -> Unit):Int{
        return this.database.update(this.sourceTable,block)
    }
    fun <E : Any, T : BaseTable<E>> EntitySequence<E, T>.delete(  predicate: (T) -> ColumnDeclaring<Boolean>):Int{
        return this.database.delete(this.sourceTable,predicate)
    }
    fun <E : Any, T : BaseTable<E>> EntitySequence<E,T>.joinReferencesAndSelect():EntitySequence<E, T>{
        return this.database.sequenceOf(this.sourceTable,true)
    }
}
